// 7_11.c Mathematical Recursion
#include <stdio.h>

int main()
{
    int n, result;
    int factorial(int); /*function prototype*/

    printf("Enter a numbers: ");
    scanf("%d", &n);
    result = factorial(n);
    printf("\nThe factorial of %d is %d\n", n, result);

    return 0;
}

int factorial(int n)
{
    if (0 == n)
        return (1);
    else
        return (n * factorial(n - 1));
}
